/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019.
 * Description: export some chip ID
 * Author: xiaowei <xiaowei774@huawei.com>
 * Create: 2018-09-15
 */

#ifndef	__KEXPORT_H__
#define	__KEXPORT_H__

#define CHIP_ID_SERIAL_VERSION_MASK     0xfffff000
#define CHIP_ID_SERIAL_MASK             0xffff0000
#define CHIP_ID_VERSION_MASK            0xf000
#define CHIP_ID_SUB_VERSION_MASK        0xffffff00

/* SERIAL_VERSION after the mask of CHIP_ID_SERIAL_VERSION_MASK,not care the last 3 bits */
#define CHIP_ID_SD5115H    0x51150000
#define CHIP_ID_SD5115S    0x51151000
#define CHIP_ID_SD5115T    0x51152000

#define CHIP_ID_SD5116H    0x51160000
#define CHIP_ID_SD5116S    0x51161000
#define CHIP_ID_SD5116T    0x51162000
#define CHIP_ID_SD5116L    0x51163000

#define CHIP_ID_SD5118    0x51180100
#define CHIP_ID_SD5118V2  0x51180200
#define CHIP_ID_SD5117H   0x51170000
#define CHIP_ID_SD5117P   0x51176000

#define CHIP_ID_SD5610H   0x56100000
#define CHIP_ID_SD5610T   0x56102000

/* serial after the mask of CHIP_ID_SERIAL_MASK,not care the last 4 bits */
#define CHIP_ID_SD5115_SERIAL   0x51150000
#define CHIP_ID_SD5116_SERIAL   0x51160000
#define CHIP_ID_SD5118_SERIAL   0x51180000
#define CHIP_ID_SD5117_SERIAL   0x51170000

/* version after the mask of CHIP_ID_VERSION_MASK,not care the last 3 bits */
#define CHIP_ID_H_VERSION   0x0000
#define CHIP_ID_S_VERSION   0x1000
#define CHIP_ID_T_VERSION   0x2000
#define CHIP_ID_L_VERSION   0x3000

/* sd5115 kernel export functions */
typedef enum {
	HI_CHIP_ID_NONE_E = 0x0,
	HI_CHIP_ID_5115S_E,
	HI_CHIP_ID_5115H_E,
	HI_CHIP_ID_5115T_E,
	HI_CHIP_ID_5116S_E,
	HI_CHIP_ID_5116H_E,
	HI_CHIP_ID_5116T_E,
	HI_CHIP_ID_5116L_E,
	HI_CHIP_ID_5118_E,
	HI_CHIP_ID_5118V2_E,
	HI_CHIP_ID_5117H_E,
	HI_CHIP_ID_5117P_E,
	HI_CHIP_ID_5610H_E,
	HI_CHIP_ID_5610T_E,
	HI_CHIP_ID_MPW_E,
} hi_chip_id_e;

/* extern int acp_en; */

hi_chip_id_e hi_kernel_get_chip_id(void);
extern hi_chip_id_e hi_chip_id;
#endif      /* #ifndef	__KEXPORT_H__ */

